
from selenium.webdriver.common.by import By

from autoTest_ecshop_new1.base_page.base import BasePage
from autoTest_ecshop_new1.utils.log_util import logger
class LoginPage(BasePage):
    # 用户名定位器
    username_loc = (By.CSS_SELECTOR,'[name="username"]')
    #密码定位器
    password_loc = (By.CSS_SELECTOR, '[name="password"]')
    #denglu按钮
    loginBtn_loc = (By.CSS_SELECTOR, '[name="submit"]')
    #登录后的验证信息定位器
    homePage_loc = (By.CSS_SELECTOR, '[id="ECS_MEMBERZONE"] >font')

    usernameErr_loc=(By.XPATH,'//div[@align="center"]/p')
#登录系统
# 登录系统
    def loginSystem(self, username, password):
        # 输入用户名
        logger.info("输入用户名")
        self.input_data(self.username_loc, username)

        # 输入密码
        logger.info("输入密码")
        self.input_data(self.password_loc, password)

        # 点击登录按钮
        logger.info("点击登录按钮")
        self.click_btn(self.loginBtn_loc)
        #错误登录







